#include "xfile.h"
#include "qdebug.h"

XFILE::XFILE(QObject *parent): QObject{parent}
{

}

void XFILE::create_file(QString path)
{
    QDir dir(path);
    if(!dir.exists())
    {
       dir.mkpath(path);
       qDebug()<<"文件夹创建成功";
    }
    else
    {
        return;
    }
}

void XFILE::set_value(QString node_key, QString path, QVariant value)
{
    QSettings settings(path, QSettings::IniFormat);
    settings.setValue(node_key, value);
}

QVariant XFILE::get_value(QString node_key, QString path)
{
    QSettings settings(path, QSettings::IniFormat);
    QVariant name = settings.value(node_key);

    return name;
}
